package thread.lockyureentrantlock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class LockShiYong {

    int a =0;

    public void update(){
        Lock lock = new ReentrantLock();
        lock.lock();
        a++;
        System.out.println("a:"+a);
        lock.unlock();


    }

    public static  void main(String[] args){
        LockShiYong lockShiYong = new LockShiYong();
        lockShiYong.update();

    }
}
